<template>
	<view class="content">
		<view class="title">{{datas.protocolTitle}}</view>
		<view class="list">
			<rich-text :nodes="datas.protocolContent"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:'',
				datas:{}
			}
		},
		onLoad(options) {
			console.log(options)
			let title;
			if (Object.keys(options).length != 0) {
				this.type = options.type
				if (this.type == 1) {
					title = '用户协议'
				} else if (this.type == 2) {
					title = '隐私协议'
				} else if (this.type == 3) {
					title = '佣金提现规则'
				} else if (this.type == 4) {
					title = '余额提现规则'
				}
				uni.setNavigationBarTitle({
					title: title
				})
				this.getProctol()
				
			}
			
		},
		methods: {
			getProctol: function () {
				this.api.getProtolInfo(this.type).then(res => {
					console.log(res)
					this.datas = res.data;
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		width: 100%;
		box-sizing: border-box;
		letter-spacing: 3rpx;
		padding: 20rpx;
		border-top: 2rpx solid #F5F5F5;
		background: #FFFFFF;
	}
	.content {
		width: 100%;
		box-sizing: border-box;
	}
	.title {
		width: 100%;
		box-sizing: border-box;
		line-height: 80rpx;
		font-size: 32rpx;
		text-align: center;
	}
	.list {
		width: 100%;
		box-sizing: border-box;
		padding: 20rpx;
	}
	

</style>
